import type { TableColumn } from '@/components/core/dynamic-table';

export type TableListItem = API.UserListPageResultItem;
export type TableColumnItem = TableColumn<TableListItem>;

const operationParams = [
  {
    label: '液相色谱类型的分析方法',
    value: 1,
  },
  {
    label: '分子生物学分析法',
    value: 2,
  },
];
const operationParams2 = [
  {
    label: '启用',
    value: 1,
  },
  {
    label: '禁用',
    value: 2,
  },
];

export const baseColumns: TableColumn[] = [
  {
    title: '关键字',
    align: 'left',
    dataIndex: 'keyword',
    hideInTable: true,
    formItemProps: {
      labelWidth: 55,
      componentProps: () => {
        return {
          placeholder: '可输入文档名称搜索',
          disabledLabelWidth: true,
        };
      },
    },
  },
  {
    title: '方法编码',
    align: 'left',
    dataIndex: 'userNum',
    hideInSearch: true,
  },
  {
    title: '方法名称',
    align: 'left',
    dataIndex: 'userLogin',
    hideInSearch: true,
  },
  {
    title: '所属分类',
    align: 'left',
    dataIndex: 'type',
    formItemProps: {
      component: 'Select',
      componentProps: {
        options: operationParams,
      },
    },
    customRender: ({ record }) =>
      operationParams.filter((item) => item.value == record.type)[0].label,
  },
  {
    title: '版本号',
    align: 'left',
    dataIndex: 'userName',
    hideInSearch: true,
  },
  {
    title: '发布日期',
    align: 'left',
    dataIndex: 'action',
    hideInSearch: true,
  },

  {
    width: 300,
    title: '适用范围',
    align: 'left',
    dataIndex: 'operationTime',
    hideInSearch: true,
  },
  {
    title: '创建时间',
    align: 'left',
    dataIndex: 'operationName',
    hideInSearch: true,
  },
];
